﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
 *@Generator -> Window Dialog Plugins - Build 2009-5-11
 *@Copyright (c) 2009 LiHuiGang - lhgdialog.js
 -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script type="text/javascript">
var W = frameElement._dlgargs.win, dlgcover = W.J.dialog.gcover(), l = window.document;
function A(){ return frameElement._dlgargs; };
window.focus(); document.write( W.J.gtlk('lhgdialog.css') );

if(W.J.ie)
{
    try{ document.execCommand('BackgroundImageCache',false,true); }
	catch(e){}
};

var recontze = function()
{
    if( W.J.ie && !W.J.i7 )
	{
		W.J('contain',l).stcs({
			width: document.body.offsetWidth - 2 + 'px',
			height: document.body.offsetHeight - 2 + 'px'
		});
	}
    var h = W.J('#contain',l).offsetHeight; h -= W.J('#dtit',l).offsetHeight;
	h -= W.J('#dfoot',l).offsetHeight; W.J('dinner',l).stcs({height:Math.max(h-9,0)+'px'});
};

var crtel = function( t, l, w, h )
{
	var o = W.J(A().top.document).crte('div');
	W.J(o).stcs({
		position: 'absolute', top: t + 'px', left: l + 'px', border: '1px solid #000',
		width: w + 'px', height: h + 'px', zIndex: W.J.dialog.cfg.bzi + 1, backgroundColor: '#999'
	}).stopac(0.30);
	W.J(A().top.document.body).apch(o); return o;
};

var drag = function()
{
    var regwin = [], lacoor, curpos, tdark;
	
	var cluphdl = function()
	{
	    for( var i = 0; i < regwin.length; i++ )
		{
		    W.J(regwin[i].document).revt( 'mousemove', dragmovehdl );
			W.J(regwin[i].document).revt( 'mouseup', draguphdl );
		}
	};
	
	var dragmovehdl = function(ev)
	{
	    if(!lacoor) return;
		if(!ev) ev = W.J.edoc(this).parentWindow.event;
		
		var curcoor = { x : ev.screenX, y : ev.screenY };
		curpos =
		{
		    x : curpos.x + ( curcoor.x - lacoor.x ),
			y : curpos.y + ( curcoor.y - lacoor.y )
		};
		lacoor = curcoor;
		
		W.J(tdark).stcs({ left: curpos.x + 'px', top: curpos.y + 'px' });
	};
	
	var draguphdl = function(ev)
	{
	    if(!lacoor) return;
		if(!ev) ev = W.J.edoc(this).parentWindow.event; cluphdl();
		W.J.rech(tdark); lacoor = null; tdark = null;
		W.J(frameElement).stcs({ left: curpos.x + 'px', top: curpos.y + 'px' });
	};
	
	return {
	    downhdl : function(ev)
		{
		    var view = null;
			if(!ev){ view = W.J.edoc(this).parentWindow; ev = view.event; } else view = ev.view;
			var tget = ev.srcElement || ev.target; if( tget.id == 'xbtn' ) return;
			
			var fw = frameElement.offsetWidth, fh = frameElement.offsetHeight;
			curpos = { x : frameElement.offsetLeft, y : frameElement.offsetTop };
			lacoor = { x : ev.screenX, y : ev.screenY }; tdark = crtel( curpos.y, curpos.x, fw, fh );
			
			for( var i = 0; i < regwin.length; i++ )
			{
				W.J(regwin[i].document).aevt( 'mousemove', dragmovehdl );
				W.J(regwin[i].document).aevt( 'mouseup', draguphdl );
			}
			
			if(ev.preventDefault) ev.preventDefault(); else ev.returnValue = false;
		},
		
		reghdl : function(w){ regwin.push(w); }
	};
}();	

var resize = function()
{
    var regwin = [], lacoor, curpos, tdark, frsize;
		
	var movehdl = function(ev)
	{
	    if(!lacoor) return;
		if(!ev) ev = W.J.edoc(this).parentWindow.event;
		
		var curcoor = { x : ev.screenX, y : ev.screenY };
		frsize = { w : curcoor.x - lacoor.x, h : curcoor.y - lacoor.y };
		if( frsize.w < 200 || frsize.h < 100 ){ frsize.w = 200; frsize.h = 100 };
		
		W.J(tdark).stcs({ width: frsize.w + 'px', height: frsize.h + 'px', top: curpos.y + 'px', left: curpos.x + 'px' } );
	};
	
	var uphdl = function(ev)
	{
	    if(!lacoor) return;
		if(!ev) ev = W.J.edoc(this).parentWindow.event;
	    
		for( var i = 0; i < regwin.length; i++ )
		{
		    W.J(regwin[i].document).revt( 'mousemove', movehdl );
			W.J(regwin[i].document).revt( 'mouseup', uphdl );
		}
		
		W.J(frameElement).stcs({ width: frsize.w + 'px', height: frsize.h + 'px' } );
		recontze(); W.J.rech(tdark); lacoor = null; tdark = null;
		if( W.J.ie && !W.J.i7 && W.J('#frmain',l) ) W.J('#frmain',l).height = W.J('#dinner',l).style.height;
	};
	
	return {
	    downhdl : function(ev)
		{
		    var view = null;
			if(!ev){ view = W.J.edoc(this).parentWindow; ev = view.event; } else view = ev.view;
			
			var fw = frameElement.offsetWidth, fh = frameElement.offsetHeight;
			curpos = { x : frameElement.offsetLeft, y : frameElement.offsetTop }; frsize = { w : fw, h : fh };
			lacoor = { x : ev.screenX - fw, y : ev.screenY - fh }; tdark = crtel( curpos.y, curpos.x, fw, fh );
			
			for( var i = 0; i < regwin.length; i++ )
			{
			    W.J(regwin[i].document).aevt( 'mousemove', movehdl );
				W.J(regwin[i].document).aevt( 'mouseup', uphdl );
			}
			
			if(ev.preventDefault) ev.preventDefault(); else ev.returnValue = false;
		},
		
		reghdl : function(w){ regwin.push(w); }
	};
}();

(function()
{
    window.onload = function()
	{
		W.J('throbber',l).stcs('visibility',''); loadinnfrm(); W.J(document).cmenu(W.J.canc);
		if(W.J.ie) W.J(window.document).msdown(setzi); else W.J(window).msdown(setzi);
		
		W.J('dtit',l).msdown(drag.downhdl); drag.reghdl(window); drag.reghdl(A().top); drag.reghdl(W);
		W.J('dark',l).msdown(resize.downhdl); resize.reghdl(window); resize.reghdl(A().top); resize.reghdl(W);
		
		if( A().link || A().html ) W.J('throbber',l).stcs('visibility','hidden'); setbtn(); recontze();
		var oid = frameElement.id.substr(4), o = W.J.dialog; o.indoc[oid] = document; o.infrm[oid] = W.J('#frmain',l); o.inwin[oid] = window;
	};
	
	window.loadinnfrm = function()
	{
	    if(A().html) W.J('dinner',l).html( A().html );
		else
		{
		    var _src = A().link ? A().link : A().page, _css = A().link ? '' : 'style="visibility:hidden;" ';
			W.J('dinner',l).html( '<iframe id="frmain" src="' + _src + '" name="frmain" frameborder="0" ' +
			                      'width="100%" height="100%" scrolling="auto" ' + _css + 'allowtransparency="true"><\/iframe>' );
		}
	};
	
	window.loadinndlg = function()
	{
	    if( !frameElement.parentNode ) return null;
		var frmain = W.J('#frmain',l), innwin = frmain.contentWindow, inndoc = innwin.document;
		
		W.J('throbber',l).stcs('visibility','hidden'); frmain.style.visibility = '';
		if(W.J.ie) W.J(inndoc).msdown(setzi); else W.J(innwin).msdown(setzi);
		drag.reghdl(innwin); resize.reghdl(innwin); innwin.focus(); return W;
	};
	
	window.cancel = function(){ return closedlg(); };
	window.closedlg = function()
	{
	    if( W.J('#frmain',l) ) W.J('#frmain',l).src = W.J.gtvod();
		W.J('throbber',l).stcs('visibility','hidden'); W.J.dialog.close( window, dlgcover );
	};
	
	window.reload = function(win,url,b)
	{
	    win = win ? win : W; W.J.dialog.close( window, dlgcover );
		if(!url) win.location.reload();
		else
		{
		    if(!b) win.location.href = url; else win.src = url;
		}
	};
	
	var setzi = function(ev)
	{
	    if(!ev) ev = event || this.parentWindow.event;
		W.J(frameElement).stcs('zIndex',parseInt(W.J.dialog.cfg.bzi,10) + 1);
		
		W.J.dialog.cfg.bzi = frameElement.style.zIndex;
		ev.stopPropagation ? ev.stopPropagation() : (ev.cancelBubble = true);
	};
	
	var setbtn = function()
	{
	    if(W.J.ie){ var img = new Image(); img.src = 'images/btn_bg.gif'; };
		
		W.J('xbtn',l).msover(function(){
		    W.J(this).stcs('backgroundPosition','0 0');
		}).msout(function(){
		    W.J(this).stcs('backgroundPosition','-22px 0');
		}).click(cancel); W.J('txt',l).html(A().tit); crebtn( 'cbtn', '取 消', cancel );
	};
	
	window.crebtn = function(i,t,f)
	{
	    if(W.J('#'+i,l)){ W.J(i,l).html( '<span>' + t + '</span>' ); W.J(i,l).click(f); }
		else
		{
		    var li = W.J(l).crte('li'), span = W.J(l).crte('span');
			W.J(span).html(t); W.J(li).attr('id',i).apch(span);
			
			W.J(li).msover(function(){
			    W.J(this).stcs('backgroundPosition','0 -42px');
			}).msout(function(){
			    W.J(this).stcs('backgroundPosition','0 -21px');
			}).click(f); W.J('btns',l).apch(li); li = span = null;
		}
	};
	
	window.rembtn = function(id){ if(W.J('#'+id,l)) W.J.rech(W.J('#'+id,l)); };
})();
	</script>
</head>

<body>
    <div id="contain" class="contain">
	    <div id="dtit" class="dlgtit"><span id="txt"></span><div id="xbtn"></div></div>
		<div id="dinner" class="dlginner"></div>
		<div id="dfoot" class="dlgfoot"><ul id="btns"><li id="dark"></li></ul></div>
	</div>
	<div id="throbber" style="position:absolute;visibility:hidden;">正在加载窗口内容，请稍等....</div>
</body>
</html>